<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="__UI__/css/mylogin.css" media="all">


    <title>生产车间管理系统-后台登录</title>

    <style>
        #login{
            margin-top: 30px;
            width: 35%;
            padding: 10px 20px;
            background: #fff;
            outline: none;
            border: none;
            border-radius: 30px;
            border: 1px solid rgba(255, 255, 255, 0.5);
            border-right: 1px solid rgba(255, 255, 255, 0.2);
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            font-size: 16px;
            letter-spacing: 1px;
            color: #666;
            box-shadow: 0 5px 15px rgb(0 0 0 / 5%);
            font-weight: 600;
            cursor: pointer;
        }
        #code_input{
            float: left;
        }
        #code{
            float: left;
            width: 48%;
        }
        #refreshCaptcha{
            float: left;
            width: 47%;
            margin-left: 5%;
        }
        h3{
            color: white;
            font-size: 20px;
        }
        #reg_div a{
            color: #666;
            text-decoration: none;
        }

    </style>
</head>

<body>
    <section>
        <!-- 背景颜色 -->
        <div class="color"></div>
        <div class="color"></div>
        <div class="color"></div>
        <div class="box">
            <!-- 背景圆 -->
            <div class="circle" style="--x:0"></div>
            <div class="circle" style="--x:1"></div>
            <div class="circle" style="--x:2"></div>
            <div class="circle" style="--x:3"></div>
            <div class="circle" style="--x:4"></div>
            <!-- 登录框 -->
            <div class="container">
                <div class="form">
                    <h1 style="font-size: 24px">智能工厂生产车间管理系统</h1>
                    <h3>后台登录</h3>
                    <form id="form">
                        <div class="inputBox">
                            <input type="text" name="user" placeholder="请输入用户名">

                        </div>
                        <div class="inputBox">
                            <input type="password" name="psw" placeholder="请输入密码">

                        </div>
                        <div class="inputBox" id="code_input">
                            <input type="text" id="code" name="code" placeholder="请输入验证码" maxlength="4">
                            <img id="refreshCaptcha" class="validateImg"  src="{:captcha_src()}" >
                        </div>

                        <div class="inputBox">
                            <button type="button" id="login">登录</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>

    <script src="__UI__/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
    <script src="__UI__/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="__UI__/js/common.js" charset="utf-8"></script>
    <script type="text/javascript">

        // 登录过期的时候，跳出ifram框架
        if (top.location != self.location) top.location = self.location;

        //点击登录执行登录操作
        $('#login').on('click',function () {
            postSubmit($,"{:url('admin/index/login')}",$('#form').serialize(),function (res) {
                if(res.result){
                    window.location.href = "{:url('admin/index/index')}";
                }
            },function () {$('#refreshCaptcha').click();});
        });
        $('#refreshCaptcha').on('click', function(){
            $(this).attr('src','/captcha.html?t='+Math.random());
        });

        //点击回车按钮 执行登录操作
        document.onkeydown = function(){
            if(event.keyCode == "13"){
                document.getElementById("login").click();
            }
        }
    </script>
</body>

</html>